using System;
using System.Collections.Generic;
using System.Text;


using System.Data;
using System.Data.Common;
using Husb.Data;
using Husb.DataUtil;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Caching;

using CentralOffice.MyTable.Data;

using EmailTable = CentralOffice.MyTable.Data.EmailDataSet.emailDataTable;
using EmailRow = CentralOffice.MyTable.Data.EmailDataSet.emailRow;

namespace CentralOffice.MyTable.DataAccess
{
    public class EmailAdapter : DataAccessAdapter<MyTable.Data.EmailDataSet, EmailTable, EmailRow>
    {
        public EmailAdapter()
        {
            this.TableName = "Email";
            DeleteStoredProc = "Email_DeleteEmail";

            GetAllStoredProc = "Email_SelectEmailAll";
            InsertStoredProc = "Email_InsertEmail";
            UpdateStoredProc = "Email_UpdateEmail";
            FindStoredProc = "Email_SelectEmailDynamic";
            GetByIdStoredProc = "Email_SelectEmail";
            GetPagedStoredProc = "Email_SelectEmailPaged";
            GetRowCountStoredProc = "Email_SelectEmailRowCount";
        }

        protected override void PopulateInsertParameters(Microsoft.Practices.EnterpriseLibrary.Data.Database db, System.Data.Common.DbCommand cmd)
        {
            db.AddInParameter(cmd, "Id", DbType.Guid, "Id", DataRowVersion.Current);
            db.AddInParameter(cmd, "ToId", DbType.String, "ToId", DataRowVersion.Current);
            db.AddInParameter(cmd, "ReadFlag", DbType.String, "ReadFlag", DataRowVersion.Current);
            db.AddInParameter(cmd, "DeleteFlag", DbType.String, "DeleteFlag", DataRowVersion.Current);
            db.AddInParameter(cmd, "BoxId", DbType.String, "BoxId", DataRowVersion.Current);
            db.AddInParameter(cmd, "BodyId", DbType.String, "BodyId", DataRowVersion.Current);
            db.AddInParameter(cmd, "ToEmp", DbType.String, "ToEmp", DataRowVersion.Current);
        }
    }
}
